Hi developers!
I have created a textbox with a button in it so it looks like a combobox. For the dropdown menu I use a popup. I did this because I have a treeview inside the dropdown menu and a small summary of what is selected in the treeview as the SelectedItem.
Here is my problem: When I click the button when the popup is open it closes the popup first and then due to the button's click event the popup opens up again and I want to prevent this behavior.
My idea for the solution is to have a bool variable which is set true when the popup is closed because one clicked the button and the button click event only opens the popup when the variable is false. But this only applies when you know exactly you didn't click anywhere else.
Has somebody a solution for this problem?
Thank in advance
Pravesh Singh
10-Aug-2013You can solve this problem by setting the button's IsEnabled to false when the popup is opened and setting it back to true when the popup's Closed-Event is called.